前言最近使用视频库,遇到一个尴尬的问题
iOS 10 以前
//用来返回是前置摄像头还是后置摄像头123456789101112- (AVCaptureDevice *)cameraWithPostion:(AVCaptureDevicePosition)position{ //返回和视频录制相关的默认设备 NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; //遍历这些设备返回跟postion相关的设备 for (AVCaptureDevice *device in devices) { if ([device position] == position) { return device; } } return nil;}
iOS10 之后
|
|